package com.heima.wemedia.controller.v1;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.pojos.ApUser;
import com.heima.model.wemedia.dtos.WmLoginDto;
import com.heima.wemedia.service.IWmUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping
public class WmUserController {
    @Autowired
    private IWmUserService wmUserService;
    /**
     * 自媒体端登录接口
     * @param dto
     * @return
     */
    @PostMapping("/login/in")
    public ResponseResult login(@RequestBody WmLoginDto dto){
        return wmUserService.login(dto);
    }

    /**
     * 新增自媒体用户
     * @param apUser
     */
    @PostMapping("/api/v1/user/save")
    public ResponseResult saveWmUser(@RequestBody ApUser apUser){
        return wmUserService.saveWmUser(apUser);
    }
}
